home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / POKE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  577 b   |  19 lines

  1. /* POKE.C --- p. 648 */
  2. #include <stdio.h>
  3. #include <dos.h>
  4. main()
  5. {
  6.     unsigned seg, off;
  7.     unsigned char c;
  8.     printf("Enter address (SSSS:0000) of byte\n"
  9.                "location whose contents you want to change: ");
  10.     printf("\nTry B800:0 for CGA or B000:0 for a monochrome display\n");
  11.     scanf(" %x:%x", &seg, &off);
  12.                 /* First get the contents using 'peekb'  */
  13.     c = peek(seg, off);
  14.     printf("(%X:%X) contains %X(hex) or %c\n. Change to (in hex): ",
  15.                             seg, off, c, c);
  16.     scanf(" %x", &c);
  17.             /* Use 'pokeb' to load c into that location */
  18.     pokeb(seg, off, c);
  19. }